//
//  JobCollectionTableViewCell.m
//  CYWFrame
//
//  Created by 于顺燊 on 2018/10/22.
//  Copyright © 2018年 Macx. All rights reserved.
//

#import "JobCollectionTableViewCell.h"

@implementation JobCollectionTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
	
	[self.selectBtn setImage:IMAGE(@"shop_car_chose") forState:UIControlStateSelected];
}

- (void)setJobInfo:(JobInfoForRecruitIndex *)jobInfo
{
	if (_jobInfo != jobInfo) {
		_jobInfo = jobInfo;
	}
	_jobName.text = jobInfo.category_title;
	_jobName.font = [UIFont boldSystemFontOfSize:20];
	
	NSLog(@"the workExp is %@", jobInfo.work_life);
	[self.workExp setTitle:jobInfo.work_life forState:UIControlStateNormal];
	
	[self.edu setTitle:jobInfo.education forState:UIControlStateNormal];
	
	[_companyLogo sd_setImageWithURL:[NSURL URLWithString:jobInfo.logo] placeholderImage:IMAGE(@"placeHolder")];
	
	if ([jobInfo isKindOfClass:[JobInfoForRecruitIndex class]]) {
		//_companyName.text = jobInfo.company_name;
		_companyName.text = jobInfo.title;
	}
	else
		_companyName.text = jobInfo.title;
	
	NSLog(@"the address is %@", jobInfo.address);
	[self.address setTitle:jobInfo.address forState:UIControlStateNormal];
	
	_salary.text = jobInfo.salary;
	_salary.textAlignment = NSTextAlignmentRight;
	_salary.textColor = [UIColor redColor];
	
	_postDate.text = @"8月8号";
	_postDate.textAlignment = NSTextAlignmentRight;
	_postDate.textColor = RGB(196, 196, 196);
}

- (void)setFrame:(CGRect)frame
{
	frame.origin.y += 10;
	frame.size.height -= 10;
	
	[super setFrame:frame];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
